import DeviceCard from "@site/src/components/DeviceCard"

# RP2040

The following devices use the firmware from https://github.com/microsoft/devicescript-pico
which builds on top of the pico-sdk.

{@import ./boards.mdp}

:::note

The pico-w networking stack (cloud, etc...) is currently not well supported.
We are currently focusing on best support on [ESP32](/devices/esp32/).

If you have expertise with the pico SDK, your contribution is welcome to fill the gaps.

:::

## Usage

You can use `devicescript flash rp2040` command to flash RP2040-based boards.

Plug in your RP2040 board while holding `BOOTSEL` button the run this command. The bootloader drive should be discovered by your operating system.

```bash
devicescript flash rp2040
```

```console title="Output"
$ devicescript flash rp2040
Please select board, available options:
    --board msr124                     RP2040 124 v0.1
    --board msr59                      RP2040 59 v0.1
    --board pico_w                     Raspberry Pi Pico W
fatal: missing --board
$
```

Let's say your board is `pico_w`, you run

```bash
devicescript flash rp2040 --board pico_w
```

```console title="Output"
$ devicescript flash rp2040 --board pico_w
using drive /Volumes/RPI-RP2/
fetch https://github.com/microsoft/jacdac-pico/releases/latest/download/devicescript-rp2040w-pico_w.uf2
saved .devicescript/cache/devicescript-rp2040w-pico_w.uf2 336896 bytes
cp .devicescript/cache/devicescript-rp2040w-pico_w.uf2 /Volumes/RPI-RP2/
OK
$
```

After flashing, your board has the DeviceScript runtime and you can program it using DeviceScript.
